import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('../views/layout/Layout.vue'),
      redirect: '/home',
      children: [
        {
          path: 'home',
          name: 'home',
          meta: { title: '首页' },
          component: () => import('../views/home/index.vue')
        },
        {
          path: 'clue/list',
          name: 'clueList',
          meta: { title: '线索列表' },
          component: () => import('../views/clue/list.vue')
        },
        {
          path: 'clue/pool',
          name: 'cluePool',
          meta: { title: '线索池' },
          component: () => import('../views/clue/pool.vue')
        },
        {
          path: 'business/list',
          name: 'businessList',
          meta: { title: '商机列表' },
          component: () => import('../views/business/list.vue')
        },
        {
          path: 'business/pool',
          name: 'businessPool',
          meta: { title: '公海池' },
          component: () => import('../views/business/pool.vue')
        },
        {
          path: 'customer',
          name: 'customer',
          meta: { title: '客户管理' },
          component: () => import('../views/customer/index.vue')
        },
        {
          path: 'resource/course',
          name: 'courseManagement',
          meta: { title: '课程管理' },
          component: () => import('../views/resource/course.vue')
        },
        {
          path: 'resource/activity',
          name: 'activityManagement',
          meta: { title: '活动管理' },
          component: () => import('../views/resource/activity.vue')
        },
        {
          path: 'system/dept',
          name: 'deptManagement',
          meta: { title: '部门管理' },
          component: () => import('../views/system/dept.vue')
        },
        {
          path: 'system/role',
          name: 'roleManagement',
          meta: { title: '角色管理' },
          component: () => import('../views/system/role.vue')
        },
        {
          path: 'system/user',
          name: 'userManagement',
          meta: { title: '用户管理' },
          component: () => import('../views/system/user.vue')
        },
        {
          path: 'system/log',
          name: 'systemLog',
          meta: { title: '系统日志' },
          component: () => import('../views/system/log.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login/index.vue')
    }
  ],
})

export default router
